package com.tjut.oop.hol4;

public class HourlyEmployee extends ColaEmployee {
	// 工作的小时数
	private int WorkHours;
	// 每小时的工资
	private double HourSalary;


	public HourlyEmployee(String staffNam, int staffBirthMonth, int workHours, double hourSalary) {
		super(staffNam, staffBirthMonth);
		WorkHours = workHours;
		HourSalary = hourSalary;
	}


	public HourlyEmployee(String staffNam, int staffBirthMonth) {
		super(staffNam, staffBirthMonth);
		// TODO Auto-generated constructor stub
	}


	public double getSalary(int month){
		if(WorkHours>160)
			return (WorkHours-160)*HourSalary*1.5+160*HourSalary
					+super.getSalary(month);
		else
			return WorkHours*HourSalary+super.getSalary(month);
	}

}
